<template>
  <el-button
    :type="type"
    :style="type === 'text' ? 'padding: 0' : ''"
    @click="confirm"
    >{{ text }}</el-button
  >
</template>

<script>
export default {
  name: "ElPopconfirm",
  props: {
    title: {
      type: String,
    },
    type: {
      type: String,
      default: "primary",
    },
    text: {
      type: String,
      default: "提交",
    },
  },
  components: {},
  data() {
    return {};
  },
  computed: {},
  methods: {
    confirm() {
      this.$alert(this.title, "提示", {
        type: "warning",
        dangerouslyUseHTMLString: true,
        showCancelButton: true,
      }).then(() => {
        this.$emit("confirm");
      });
    },
  },
};
</script>
